﻿using System.Linq;
using YawetagDemo.Framework.Data;
using YawetagLib.System.Utilities;

namespace YawetagDemo.WebUI.Models
{
    public class ArtistModel
    {
        public ArtistModel(IArtist entity)
        {
            PersonModel person = new PersonModel(entity.Person);

            Name = person.Name;
            DOB = person.DOB;
            Age = person.Age;

            Bands = entity.Bands.Select(i => i.Name).ToArray().ToDelimitedSequence(", ");
        }

        public string Name { get; private set; }
        public string DOB { get; private set; }
        public string Age { get; private set; }

        public string Bands { get; private set; }
    }
}
